#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int a, b, n=0, i=a;
	scanf("%d%d", &a, &b);
	while (i <= b)
	{
		if((i%4==0&&i%100!=0)||i%400==0)
		n++;
		i++;
	}
	printf("%d", n);
	return 0;
}